﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    SelectDoLuuNiem
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent1" runat="server">
    <h2>Chi tiết đồ lưu niệm</h2>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent2" runat="server">
    <script src="../../Scripts/NumberFormat.js" type="text/javascript"></script>
    <script src="../../Scripts/fckeditor/fckeditor.js" type="text/javascript"></script>
    <script type="text/javascript">
        window.onload = function () {
            var objFckEditor = new FCKeditor('DoLuuNiem_NoiDung');
            objFckEditor.BasePath = '<%= ResolveUrl("~/Scripts/fckeditor/")%>';
            objFckEditor.Height = 480;
            objFckEditor.Width = 600;
            objFckEditor.ToolbarSet = 'TemplateWeb.MyToolbar';
            objFckEditor.ReplaceTextarea();
        }

        function formatNumber() {
            var numElem = document.getElementsByName("DoLuuNiem_Gia").item(0);
            var numVal = numElem.value.replace(",", "").replace(".", "");
            if (!isNaN(numVal)) {
                var numFormated = FormatNumberBy3(numVal, ",", ".");
                document.getElementById("gia_coverted").innerHTML = numFormated;
            }

            numElem = document.getElementsByName("DoLuuNiem_SoLuongTon").item(0);
            numVal = numElem.value.replace(",", "").replace(".", "");
            if (!isNaN(numVal)) {
                var numFormated = FormatNumberBy3(numVal, ",", ".");
                document.getElementById("soluongton_converted").innerHTML = numFormated;
            }
        }
    </script>
    <script type="text/javascript">
		<% if (Model.DoLuuNiemModel.InfoText != null && Model.DoLuuNiemModel.InfoText != ""){ %>
			alert('<%= Model.DoLuuNiemModel.InfoText %>');
		<% } %>
    </script>
    <% using (Html.BeginForm("UpdateDoLuuNiem", "Admin", FormMethod.Post, new { enctype = "multipart/form-data", onsubmit = "return ValidateDoLuuNiem();" }))
       { %>
    <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="AdminPageText">
            <tbody>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">TenSanPham: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("DoLuuNiem_TenSanPham", Model.DoLuuNiemModel.GetModel.LstObjModel[0].SanPham.TenSanPham, new { @style = "width: 590px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">NoiDung: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextArea("DoLuuNiem_NoiDung", Model.DoLuuNiemModel.GetModel.LstObjModel[0].MoTa)%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">XuatXu: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("DoLuuNiem_XuatXu", Model.DoLuuNiemModel.GetModel.LstObjModel[0].XuatXu, new { @style = "width: 290px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">NhaSanXuat: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("DoLuuNiem_NhaSanXuat", Model.DoLuuNiemModel.GetModel.LstObjModel[0].NhaSanXuat, new { @style = "width: 290px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">TrongLuong: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("DoLuuNiem_TrongLuong", Model.DoLuuNiemModel.GetModel.LstObjModel[0].TrongLuong, new { @style = "width: 190px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">Gia: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("DoLuuNiem_Gia", string.Format("{0:#,##0;Nothing}", Model.DoLuuNiemModel.GetModel.LstObjModel[0].SanPham.GiaBan), new { @style = "width: 190px;", onkeyup = "formatNumber();" })%>
                            <label id="gia_coverted"></label> VNĐ
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">Số lượng tồn: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("DoLuuNiem_SoLuongTon", Model.DoLuuNiemModel.GetModel.LstObjModel[0].SanPham.SoLuongTon, new { @style = "width: 190px;", onkeyup = "formatNumber();" })%>
                            <label id="soluongton_converted"></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">HinhMinhHoa: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <input type="file" name="DoLuuNiem_HinhMinhHoa" />
                            <br />
                            <br />
                            <img src="../../Content/Images/Items/<%= Model.DoLuuNiemModel.GetModel.LstObjModel[0].SanPham.HinhMinhHoa %>"
                                width="120px" height="120px" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td height="20" style="width: 130px">
                    </td>
                    <td height="20">
                        <div align="left">
                            <br />
                            <input type="hidden" name="DoLuuNiem_ID" value="<%= Model.DoLuuNiemModel.GetModel.LstObjModel[0].ID %>" />
                            <input type="submit" value="Update" />
                            <p>
                            </p>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <% } %>
</asp:Content>
